home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 018a / amac41.zip / SZ.BAT < prev    next >
DOS Batch File  |  1991-05-28  |  3KB  |  107 lines

  1. :SZ.BAT   Search ZIP Files                                     May 27, 1991
  2. :
  3. :1) SYNTAX:                           SZ.BAT %1 %2
  4. :                                  ┌──────────┘  │
  5. :             (Mode)              %1            %2
  6. :                            Search Text     ZIP Name
  7. :         ----------------   -------------   --------
  8. :      a) Query                   [ ]           [ ]
  9. :      b) Partial Query      Search Text        [ ]
  10. :      e) All command line   Search Text     ZIP Name
  11. :
  12. :
  13. :         where:    %1  - Search Text
  14. :                   %2  - ZIP Name, no extension
  15. :
  16. :                   [ ] - entered at query prompt
  17. :2) Requires FGREP.COM    INPUT.COM    DX.EXE   PKUNZIP.EXE
  18. :            SRL.MAC
  19. :
  20. :*******************************************************************************
  21. :* Environment Variable        Action                                          *
  22. :* --------------------------- ----------------------------------------------- *
  23. :* set srmac=                  macro files are located in current directory    *
  24. :* set srmac=c:\mac\           macro files are located in c:\mac\  directory   *
  25. :* set sztemp=                 uses default c:\$zip$ for temporary directory   *
  26. :* set sztemp=e:\name          uses e:\name for temporary directory            *
  27. :*******************************************************************************
  28. :
  29. @echo OFF
  30. cls
  31. set S~~=%1
  32.  
  33. set file=%2
  34. break on
  35. if "%sztemp%" == "" set sztemp= c:\$zip$
  36. if     "%1" == ""    echo Search Text: [{Blank} terminates batch file]
  37.  
  38. if not "%1" == ""    goto 2b
  39. INPUT.COM Search Text=/b
  40. if errorlevel=1 goto 6a
  41. set S~~=%ans%
  42. goto 2a
  43. :1a
  44. echo Search Text=%S~~%
  45. :2a
  46.  
  47.  
  48.  
  49.  
  50.  
  51. :2b
  52.  
  53. set ans=
  54. if not "%2" == "" goto 2c
  55. echo ZIP Name(s): [ZIP Name(s), no ZIP extn]  [{Blank} terminates batch file]
  56. INPUT.COM ZIP Name=/b
  57. if errorlevel=1 goto 6a
  58. set file=%ans%
  59. :2c
  60. if "%file%" == ""  goto 6a
  61. if not exist %file%.ZIP goto 6a
  62. :4a
  63. CLS
  64. echo Search Text   = %S~~%
  65.  
  66. echo ZIP Name      = %file%.ZIP
  67.  
  68. if not exist %sztemp%\nul md %sztemp%
  69. PKUNZIP.EXE -o %file% %sztemp%
  70. echo.
  71. DX.EXE %sztemp% //v-/fattr:!a-/he:1/st:1/out:nul
  72. DX.EXE %sztemp%\*.exe *.com *.zip *.mac *.arc//v-/del/he:1/st:1/out:nul
  73. echo.
  74. FGREP.COM -fl %S~~% %sztemp%\*.* >c:\$.ql
  75. set >c:\$
  76. copy c:\$.ql c:\!
  77. Q.EXE C:\! /E%srmac%SRL.MAC /L%srmac%SRL.MAC
  78. echo.
  79. echo.
  80.  
  81.  
  82.  
  83.  
  84. echo Deleting temporary files and removing temporary directory %sztemp% . . .
  85. echo y | erase %sztemp%\*.* >nul
  86. rd %sztemp%
  87. if exist %sztemp%\nul echo Directory %sztemp% still exists . . .
  88. erase c:\!
  89. erase c:\$.*
  90. goto 7a
  91. :6a
  92. echo.
  93. if     "%S~~%"  == ""   echo Must specify Search Text . . . .
  94.  
  95. if not exist %file%.zip echo Can't Find ZIP_File %file%.ZIP . . . .
  96. if     "%file%" == ""   echo Must Specify ZIP_File . . . .
  97. echo Search──INCOMPLETE──
  98. goto 8a
  99. :7a
  100. echo.
  101. echo Search──Complete──
  102.  
  103. :8a
  104. echo.
  105. break off
  106. echo.
  107.